#!/usr/bin/env python

import sys
if sys.version < "3.0.0":
	sys.stderr.write("Sorry, This package requires Python3.x or later.\n")
	sys.stderr.write("Please install it.\n")
	sys.exit(1)

import os
import os.path

from distutils.core import setup, Extension

madsimple = Extension('madsimple',
		include_dirs = ['/usr/include', '/usr/local/include'],
		libraries = ['mad'],
		library_dirs = ['/usr/lib', '/usr/local/ilb'],
		sources = ['extmodule/madsimple.c', 'extmodule/SimpleDecoder.c', 'extmodule/Decoder.c'])

setup(name='Sotetsu',
	version='0.2',
	description='CUI base shared Music Player',
	author='Yogi KENT',
	author_email='yogi.kent@gmail.com',
	scripts=['scripts/sotetsu'],
	packages=['sotetsu', 'sotetsu.daap', 'sotetsu.ui', 'sotetsu.player'],
	package_dir={'sotetsu': 'lib/sotetsu',
		'sotetsu.ui': 'lib/sotetsu/ui',
		'sotetsu.player': 'lib/sotetsu/player',
		'sotetsu.daap': 'lib/sotetsu/daap',
		},
	data_files= [ ('share/sotetsu', ['data/sotetsurc'] ), ],
	ext_package='sotetsu',
	ext_modules=[madsimple]
	)

#def get_mo_list():
	#rtn = []
	#for dir in os.listdir("po"):
		#mofile = "po/"+dir+"/roseus.mo"
		#if os.path.isdir("po/"+dir) and os.access(mofile, os.R_OK):
			#rtn.append( ('share/locale/'+dir+'/LC_MESSAGES', [mofile]) )
	#return rtn

#molist = get_mo_list()
#roseusdata = [ ('share/roseus', ['data/roseusrc'] ), ]
#roseusdata.append(molist)



